<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.tueye.entity.user.User"%>
<%@page import="com.tueye.utils.TuEyeConstant"%>
<%@page import="com.tueye.base.util.Page"%>
<%@page import="com.tueye.entity.Pictures"%>
<%@ include file="/common/include.jsp" %>
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
User user = (User)request.getAttribute("user");

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
     <meta http-equiv="content-Type" content="text/html; charset=utf-8" />
    <title><%=user.getByname() %>个人blog</title>
	<meta http-equiv="keywords" content="<%=user.getByname() %>个人blog " />
	<meta http-equiv="description" content="<%=user.getByname() %>个人blog" />
	
<link href="<%=path %>/themes/css/index.css" rel="stylesheet" type="text/css" />
<link href="<%=path %>/themes/css/blog.css" id ="color" rel="stylesheet" type="text/css" />
   <script type="text/javascript" src="<%=path %>/script/jquery.js"></script>
   		<script src="<%=request.getContextPath() %>/script/grid/thickbox.js" type="text/javascript"></script>
   <style type="text/css" media="all"> 
			@import "<%=request.getContextPath() %>/themes/flexigrid/css/thickbox.css"; 
		</style>

<style type="text/css">
<!--
-->
</style>
<script type="text/javascript">
function refrash(){
		$('#imgId')[0].src+='?'+Math.floor(Math.random()*10);
		}
function addgf(bloguserid){
 
var sendData="bloguserid="+bloguserid;
	$.ajax({ 
				url: "<%=request.getContextPath()%>/isGoodFriend.do" ,
				type:'post', //数据发送方式 
				dataType:'action', //接受数据格式 
				data: sendData , 
				success:function(data){ 
				debugger;
	                  if(data=="3"){ 
						alert("拒绝你加为好友！");
	                  }else if(data=="1"){
	                      $('#cssrain').trigger("click");
	                  }else if(data=="2"){
	                  	alert("该好友正在审核中...");
	                  }else{
	                    $('#cssrain').trigger("click");
	                  }
	                }
				,
	           error:function(data){
	             alert("操作出错,请重新尝试！");
	           }
			}); 
			//$('#cssrain').trigger("click");

}

function getObject(elementId) { //获取指定id的object
 if (document.getElementById) {
  return document.getElementById(elementId);
 } else if (document.all) {
  return document.all[elementId];
 } else if (document.layers) {
  return document.layers[elementId];
 }
}
function changeStyle(id){//切换样式
 var stylesheet=getObject("color").href="css/color"+id+".css";
 document.cookie="stylesheet="+escape(stylesheet);//写入Cookie
 //alert(document.cookie);
 //alert(stylesheet);
}


function initStyle(){ //初始化样式，如果cookie存在样式，则加载cookie样式，否则加载默认样式
  if(/stylesheet=([^;]+)/.test(document.cookie))//判断是否存在cookie.
   getObject("color").href=unescape(RegExp.$1);
   //alert(/stylesheet=([^;]+)/.test(document.cookie));
}
initStyle();


</script>
</head>

<body>
	<div style="display:none;">
		<input type="button" id="cssrain" href="<%=request.getContextPath() %>/pages/topics/userblog/goodFriend.jsp?height=300&amp;width=340&amp;bloguserid=<%=user.getId() %>&amp;blogusername=<%=user.getEmail() %>" 
		title="将<%=user.getByname() %>加为你的好友" class="thickbox" />
	</div>	

	
   <div id="container"> 
	 <div id="header" class="pink_back">
	    <div id="quickNav"> 
    		 <div id="bloglogo">
				<a href="${pageContext.request.contextPath }/pages/index.html" ><img src="${pageContext.request.contextPath }/themes/images/tueyelogo.gif"　width="120px" height="32px" /></a>
          </div>
			 
		  　<div class="leftMenu">
		      <a href="${pageContext.request.contextPath }/pages/index.html">首页</a> <!--有时间做成下拉 | <a href="/login">频道页</a>   -->
		  </div>
	      <div style="padding:8px 0;position:absolute ;right:30px;top:0;">
		   <%=user.getEmail() %>　<a href="${pageContext.request.contextPath }/pages/topics/usermanager/userinfoset.jsp">管理中心</a> | <a href="${pageContext.request.contextPath }/userexit.do">退出</a>
	      </div> 
     </div>
 <div id="cloud" class="floatCenter">
        <strong><%=user.getByname() %>的个人 blog</strong>
</div> 
  </div>
	
    <div id="mainbody">	 
	  <div id="leftbody">
	   <div id="userphoto">
	   <c:if test="${!empty user.userPoto }">
	    <img src="<%=path %>/pages/topics/usermanager/userphoto/${user.userPoto }"   title=""　alt=""  onload="this.style.marginTop=((this.parentElement.offsetHeight-this.offsetHeight)/2);" /> 
	   </c:if>
	   <c:if test="${empty user.userPoto }">
		 <img src="<%=path %>/themes/images/testtu2.jpg"   title=""　alt=""  onload="this.style.marginTop=((this.parentElement.offsetHeight-this.offsetHeight)/2);" /> 
		</c:if>
		</div>
		 <p id="blogname"><%=user.getByname() %></p> 
		  <ul>
		   <li style="font-size:12px; line-height:16px;">浏览：356</li>
		   <li style="font-size:12px; line-height:16px;">性别：<c:if test="${pui.sex == 1}"><font color="green">男</font></c:if><c:if test="${pui.sex == 2}"><font color="red">女</font></c:if> <c:if test="${pui.sex == 3}">主人未设</c:if>  </li>			
		   <li style="font-size:12px; line-height:16px;">来自：${user.nowHome }</li>　
			<li>
			 <a  class="home" href="javascript:alert('功能暂未启用')">详细资料</a>
			 <a  class="hi"  href="javascript:alert('功能暂未启用')">打个招呼</a>
			</li>		
			<li>
			 <a  class="duanxin" href="javascript:alert('功能暂未启用') ">发短信息</a>
			 <a  class="addfriend"  href="javascript:alert('功能暂未启用')"  >加为好友</a>
			</li>	
		  </ul>
<hr style="border:1px dashed gray; height:1px" />
<table class="flower" cellspacing="0" cellpadding="0" border="0" width="100%">
<tbody>
<tr>
<td class="flowerTitle"> 我的鲜花 </td>
<td class="flowerTitle flowerRight">
<a class="underLine" href="/myinfo/flowers">详细查看</a>
</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<td style="padding: 0pt;" colspan="2">
<table class="comments" cellspacing="0" cellpadding="0" border="0" align="center" width="100%">
<tbody>
<tr>
<td class="alignCenter" width="20%">
<img src="<%=path %>/themes/images/flower_1_b.gif"  alt="太有才了"/>
<br/>
<font class="gray">${caiNum}</font>
</td>
<td class="alignCenter" width="20%">
<img src="<%=path %>/themes/images/flower_2_b.gif" alt="鲜花支持"/>
<br/>
<font class="gray">${flowersNum }</font>
</td>
<td class="alignCenter" width="20%">
<img src="<%=path %>/themes/images/flower_3_b.gif" alt="很有用"/>
<br/>
<font class="gray">${zanNum }</font>
</td>
<td class="alignCenter" width="20%">
<img src="<%=path %>/themes/images/flower_4_b.gif" alt="口水……"/>
<br/>
<font class="gray">${kouNum }</font>
</td>
<td class="alignCenter" width="20%">
<img src="<%=path %>/themes/images/flower_5_b.gif" alt="拍的真好"/>
<br/>
<font class="gray">${paiNum }</font>
</td>
</tr>
<tr/>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br />
<table class="flower" cellspacing="0" cellpadding="0" border="0" width="100%">
<tbody>
<tr>
<td class="flowerTitle" colspan="2" >最近访客</td>  
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<c:if test="${!empty gfuser}">
 <c:forEach items="${gfuser }" var="gf">
<td class="touxiang"><img src="<%=path %>/themes/images/touxiang.jpg" width="48" height="48" /></td><td class="ddname"><a href="#">${gf.byname }</a></td>
</c:forEach>
</c:if>
</tr>
<tr><td colspan="2"  align="right"><a href="#">更多...</a></td></tr>
</tbody>
</table>

	  </div>
	  <div id="rightbody">
	  <h1>发表的图片作品</h1>
	  <ul>
	 
		<c:if test="${!empty pm.datas}">
		     <c:forEach items="${pm.datas }" var="pic">
				<li><a href="<%=path %>/pages/topics/${pic.topics.topic_type.type_enlish_name }/${pic.topics.id }"><img src="<%=path %>/pages/topics/${pic.topics.topic_type.type_enlish_name }/${pic.topics.id }/show${pic.picture_url }" height="120"  width="170"/></a><p><a href="<%=path %>/pages/topics/${pic.topics.topic_type.type_enlish_name }/${pic.topics.id }">${pic.topics.topic_title }</a></p></li>
			</c:forEach>
		</c:if>

	  </ul>
	   
		<div class="flickr"> 
			<!-- 可以在这里插入分页导航条 -->
			<pg:pager items="${pm.total}" url="userblog.do" export="currentPageNumber=pageNumber" maxIndexPages="10" maxPageItems="9" >
			  <pg:param name="userid"  value="<%=user.getId() %>" />  
				<pg:first><a href="${pageUrl}">首页</a></pg:first>
				<pg:prev><a href="${pageUrl }">前页</a></pg:prev>
				<pg:pages>
					<c:choose>
					<c:when test="${ currentPageNumber eq pageNumber}">
					<font color="red">${pageNumber}</font>
					</c:when>
					<c:otherwise>
					<a href="${pageUrl }">${pageNumber }</a>
					</c:otherwise>
					</c:choose>
				</pg:pages>
				<pg:next><a href="${pageUrl }">下页</a></pg:next>
				<pg:last><a href="${pageUrl }">尾页</a></pg:last>
			</pg:pager>            
				<%--
				  <span class="disabled"> 上一页 </span>
			     <span class="current">1</span>
			      <a href="#?page=2">2</a><a href="#?page=3">3</a><a href="#?page=4">4</a>
			      <a href="#?page=5">5</a><a href="#?page=6">6</a><a href="#?page=7">7</a>...
			      <a href="#?page=199">199</a><a href="#?page=200">200</a>
			      <a href="#?page=2"> 下一页 </a> --%>
			</div> 
	  </div>	 
	 </div>
	 
<%@ include file="../../../../common/footer.jsp" %>
</body>
</html>

